from Tkinter import *
from xmlrpclib import Server
 
class App:
	def __init__(self,parent):
		f = Frame(parent)
		f.pack(padx=30,pady=30)
    
   		self.entry = Entry(f)
		self.entry.pack(side='right')
		self.entry.focus()
		
		
		self.exit = Button(f, text="exit", command=f.quit,width=15)
		self.exit.pack(side=BOTTOM,padx=10,pady=10)
		
		self.button = Button(f, text="check spelling",command=self.spell_this,width=15)
		self.button.pack(side=BOTTOM,padx=10,pady=10)

	def spell_this(self):
		server = Server("http://localhost:7777")
		print ('The correction(s) for (%s) :' % self.entry.get())
		result = server.dict.spellThis(self.entry.get())
		if result != '':
			print result
		else:
			print 'can\'t find any matches... sorry!!!\n'

root = Tk()
root.title('The python spell checker... v1')
app = App(root)

root.mainloop()
